package com.market.controller.admin;

import com.market.bean.MarketComment;
import com.market.bean.common.BasePageInfo;
import com.market.bean.common.BaseRespVo;
import com.market.bean.common.CommonData;
import com.market.service.admin.AdminCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 商品评论
 * @author wh194@foxmail.com
 * @since 2022/12/30 21:36
 */
@RestController
@RequestMapping("admin/comment")
public class AdminCommentController {
    @Autowired
    AdminCommentService commentService;

    @GetMapping("list")
    public BaseRespVo list(BasePageInfo info, String userId, String valueId) {
        CommonData<MarketComment> data = commentService.list(info, userId, valueId);
        return BaseRespVo.ok(data);
    }

    @PostMapping("delete")
    public BaseRespVo delete(@RequestBody MarketComment comment) {
        commentService.delete(comment);
        return BaseRespVo.ok();
    }
}
